#!/bin/sh
# $Id: wheel,v 1.4 2003/08/15 19:40:37 tom Exp $
: ${VIALOG=vialog}

tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$

TITLE="This screen was taken from ComeOn Point Installer! v0.9 by ComeOn Linux!"

$VIALOG --print-maxsize 2>$tempfile
ROWS="`cut $tempfile -f1 -d, | cut -f2 -d:`"
COLS="`cut $tempfile -f2 -d,`"
rm $tempfile

# account for widest labels
COLS=`expr $COLS - 30`

# Takes an integer, multiplies it for COLS, divides for 132
scalex() {
  echo $[$1*$COLS/132]
}
scaley() {
  echo $[$1*$ROWS/60]
}

$VIALOG --backtitle "$TITLE" --no-shadow \
--begin `scaley 27` `scalex 98` --infobox "pushd /var/log >/dev/null" 0 0 --and-widget \
--begin `scaley 35` `scalex 95` --infobox "mkdir -p news -m 755" 0 0 --and-widget \
--beep --msgbox "ComeOn Linux! :-)" 0 0
